package com.yxinsur.imc.business.excel;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.yxinsur.imc.common.annotation.Excel;
import lombok.Data;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.Min;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 费率导入模板实体 RateTemplate
 *
 * @author imc
 */
@Data
public class RateTemplate implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 序号
     */
    @Excel(name = "序号*", cellType = Excel.ColumnType.NUMERIC, prompt = "数据行请保证序号不为空")
    private String index;

    /**
     * 险种代码
     */
    @Excel(name = "险种内部代码*", prompt = "注意：应为产品配置的险种内部代码而非保险公司险种代码", type = Excel.Type.IMPORT)
    private String insCode;

    /**
     * 缴费期间[起]
     */
    @Excel(name = "缴费期间[起]*", cellType = Excel.ColumnType.NUMERIC, prompt = "缴费期间应为正整数(年)", type = Excel.Type.IMPORT)
    private Integer chargePeriodLowerValue;

    /**
     * 缴费期间[止]
     */
    @Excel(name = "缴费期间[止]*", cellType = Excel.ColumnType.NUMERIC, prompt = "缴费期间应为正整数(年)", type = Excel.Type.IMPORT)
    private Integer chargePeriodUpperValue;

    /**
     * 保障期限[起]
     */
    @Excel(name = "保障期限[起]*", cellType = Excel.ColumnType.NUMERIC, prompt = "保障期限应为正整数(年)", type = Excel.Type.IMPORT)
    private Integer coveragePeriodLowerValue;

    /**
     * 保障期限[止]
     */
    @Excel(name = "保障期限[止]*", cellType = Excel.ColumnType.NUMERIC, prompt = "保障期限应为正整数(年)", type = Excel.Type.IMPORT)
    private Integer coveragePeriodUpperValue;

    /**
     * 保单年度[起]
     */
    @Excel(name = "保单年度[起]*", cellType = Excel.ColumnType.NUMERIC, prompt = "保单年度应为正整数", type = Excel.Type.IMPORT)
    private Integer payYearLower;

    /**
     * 保单年度[止]
     */
    @Excel(name = "保单年度[止]*", cellType = Excel.ColumnType.NUMERIC, prompt = "保单年度应为正整数", type = Excel.Type.IMPORT)
    private Integer payYearUpper;


    /**
     * 缴费频率
     */
    @Excel(name = "缴费频率*", comboDicType = "charge_interval", dictType = "charge_interval", type = Excel.Type.IMPORT)
    private String chargeIntervalEnum;

    /**
     * 领取年龄
     */
    @Excel(name = "领取年龄[起]", cellType = Excel.ColumnType.NUMERIC, prompt = "年龄应为正整数", type = Excel.Type.IMPORT)
    private Integer pensionAgeLower;

    /**
     * 领取年龄
     */
    @Excel(name = "领取年龄[止]", cellType = Excel.ColumnType.NUMERIC, prompt = "年龄应为正整数", type = Excel.Type.IMPORT)
    private Integer pensionAgeUpper;

    /**
     * 方案名称
     */
    @Excel(name = "方案名称", type = Excel.Type.IMPORT)
    private String insSchemeValue;

    /**
     * 扩展1
     */
    @Excel(name = "扩展1", type = Excel.Type.IMPORT)
    private String factor1Value;

    /**
     * 扩展2
     */
    @Excel(name = "扩展2", type = Excel.Type.IMPORT)
    private String factor2Value;

    /**
     * 扩展3
     */
    @Excel(name = "扩展3", type = Excel.Type.IMPORT)
    private String factor3Value;

    /**
     * 生效日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "生效日期*", width = 30, dateFormat = "yyyy-MM-dd", type = Excel.Type.IMPORT, prompt = "格式为yyyy-mm-dd")
    private Date startTime;

    /**
     * 失效日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "失效日期*", width = 30, dateFormat = "yyyy-MM-dd", type = Excel.Type.IMPORT, prompt = "格式为yyyy-mm-dd")
    private Date endTime;

    /**
     * 费率
     */
    @Excel(name = "费率*", prompt = "[折/佣/基础手续费率]应为小数类型，应输入0.9不必输入90%")
    private BigDecimal rate;


}
